package com.sam.im.heiqun.nets;

import com.sam.im.heiqun.app.App;
import com.sam.im.heiqun.constant.Constant;
import com.sam.im.heiqun.entities.AAentivity;
import com.sam.im.heiqun.entities.AddFriendEntity;
import com.sam.im.heiqun.entities.CircleItemEntity;
import com.sam.im.heiqun.entities.Circlepreview;
import com.sam.im.heiqun.entities.ColactionEntity;
import com.sam.im.heiqun.entities.FanYiBean;
import com.sam.im.heiqun.entities.GetmoneyEntivity;
import com.sam.im.heiqun.entities.ImFriendEntivity;
import com.sam.im.heiqun.entities.ImGroupEntivity;
import com.sam.im.heiqun.entities.LiangSortItem;
import com.sam.im.heiqun.entities.LoginEntivity;
import com.sam.im.heiqun.entities.MyCircleItem;
import com.sam.im.heiqun.entities.MyGiftItem;
import com.sam.im.heiqun.entities.NearbyEntivity;
import com.sam.im.heiqun.entities.PayTransferEntivity;
import com.sam.im.heiqun.entities.PayUrlInfoEntity;
import com.sam.im.heiqun.entities.PhpStatusEntivity;
import com.sam.im.heiqun.entities.ReadyEntivity;
import com.sam.im.heiqun.entities.RedPacketHistoryEntivity;
import com.sam.im.heiqun.entities.RequestRefereeEntity;
import com.sam.im.heiqun.entities.SearchGroupEntity;
import com.sam.im.heiqun.entities.SearchUserEntity;
import com.sam.im.heiqun.entities.SendCircleEntivity;
import com.sam.im.heiqun.entities.TransferViewEntivity;
import com.sam.im.heiqun.entities.TransfreCreateEntivity;
import com.sam.im.heiqun.entities.UpdateProfileEntivity;
import com.sam.im.heiqun.entities.ValidateEntivity;
import com.sam.im.heiqun.entities.VersionEntivity;
import com.sam.im.heiqun.entities.WalletDetailsEntity;
import com.sam.im.heiqun.entities.YaoyiYao;
import com.sam.im.heiqun.entities.beans.InfoBean;
import com.sam.im.heiqun.entities.weixinBean;
import com.sam.im.heiqun.entities.weixinQRData;
import com.sam.im.heiqun.uis.beans.AATransDetailBean;
import com.sam.im.heiqun.uis.beans.ContactImportEntity;
import com.sam.im.heiqun.uis.beans.GetNoticeListEntity;
import com.sam.im.heiqun.uis.beans.GetVipNumBean;
import com.sam.im.heiqun.uis.beans.GlobalRoamingBeans;
import com.sam.im.heiqun.uis.beans.GroupLevelEntity;
import com.sam.im.heiqun.uis.beans.RechargeOrderBean;
import com.sam.im.heiqun.uis.beans.ReportResultBean;
import com.sam.im.heiqun.uis.beans.queryLuckRedPacketEntivity;
import com.sam.im.heiqun.utils.ToolsUtils;

import java.util.List;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * created by arvin on 16/12/12 10:44
 */
public class PGService {
    private static final String TAG = "PGService";
    private static PGService sInstance;
    private PGNets mNet;
    private final int DEFAULT_SIZE = 15;

    private PGService() {
        mNet = PGNets.getInstance();
    }

    public static PGService getInstance() {
        if (sInstance == null) {
            sInstance = new PGService();
        }
        return sInstance;
    }

    public PGApi getNetApi() {
        return mNet.getApi();
    }

    public Observable<ValidateEntivity> getValidateNum(String mobile) {
        return mNet.getApi().getValidateNum(mobile).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /*
    注册是获取短信验证码
     */
    public Observable<ValidateEntivity> getValidateNumCheck(String mobile) {
        return mNet.getApi().getValidateNumCheck(mobile).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ImFriendEntivity> register(String headUrl, String mobile, String pwd, String name, String validateNum,String recommandUserId) {
        return mNet.getApi().register(headUrl, mobile, pwd, name, validateNum,recommandUserId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<LoginEntivity> doLogin(String mobile, String pwd,String UUID) {
//        Log.i(TAG, "doLogin: ----"+mNet.getApi().getb);
        return mNet.getApi().doLogin(mobile, pwd, Constant.DEVICE, UUID).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 修改用户隐私设置
     */
    public Observable<ValidateEntivity> updatePrivateSetting(String needAuth, String newNotification, String searchMobile, String userId) {
        return mNet.getApi().updatePrivateSetting(needAuth, newNotification, searchMobile, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ReadyEntivity> ready(String token) {
        return mNet.getApi().ready(token).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<SearchUserEntity> queryUser(String userId, String mobile) {
        return mNet.getApi().queryUser(userId, mobile).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<SearchGroupEntity> queryGroup(String userId, String groupName) {
        return mNet.getApi().queryGroup(userId, groupName).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ImGroupEntivity> createGroup(String name, String ids, String userId) {
        return mNet.getApi().createGroup(name, ids, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<SearchUserEntity> getGroupMember(String groupId, String userId) {
        String version = ToolsUtils.getVersion(App.getInstance().getApplicationContext());
        return mNet.getApi().getGroupMember(groupId, userId,version).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 修改用户资料
     */
    public Observable<UpdateProfileEntivity> updateProfile(String city, String name, String province, String sex, String sign, String userId) {
        return mNet.getApi().updateProfile(city, name, province, sex, sign, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 设置消息免打扰
     */
    public Observable<ValidateEntivity> setIgonre(String destId, String destType, String receiveTip, String userId) {
        return mNet.getApi().setIgonre(destId, destType, receiveTip, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 设置是否显示群昵称
     */
    public Observable<ValidateEntivity> showGroupMame(String userId,Long groupId,String isshowname) {
        return mNet.getApi().showGroupMame(userId, groupId, isshowname).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 同意添加好友
     */
    public Observable<ImFriendEntivity> acceptRequest(String destId, String destType, String friendGroupId, String groupId, String userId) {
        return mNet.getApi().acceptRequest(destId, destType, friendGroupId, groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 邀请好友加入群组
     */
    public Observable<ValidateEntivity> addGroupMember(String groupId, String inviteIds, String userId) {
        return mNet.getApi().addGroupMember(groupId, inviteIds, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 更换头像
     */
    public Observable<ValidateEntivity> updateHead(String headUrl, String userId) {
        return mNet.getApi().updateHead(headUrl, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 置顶聊天
     */
    public Observable<ValidateEntivity> setTop(String destId, String destType, String userId) {
        return mNet.getApi().setTop(destId, destType, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 加入黑名单
     */
    public Observable<ValidateEntivity> setBlock(String blockId, String userId) {
        return mNet.getApi().setBlock(blockId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /*
    找回密码
     */
    public Observable<UpdateProfileEntivity> findPwd(String mobile, String pwd, String validateNum) {
        return mNet.getApi().findPwd(mobile, pwd, validateNum).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ValidateEntivity> quitGroup(String groupId, String userId) {
        return mNet.getApi().quitGroup(groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ValidateEntivity> delFriend(String destId, String userId) {
        return mNet.getApi().delFriend(destId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ValidateEntivity> updateRemark(String destId, String userId, String remark) {
        return mNet.getApi().updateRemark(destId, userId, remark).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ValidateEntivity> removeBlack(String destId, String userId) {
        return mNet.getApi().removeBlack(destId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

   /* public Observable<String> sendRedPacket(String redPacketType, String userId, String redPacketCount, String redPacketContent, String destId, String destType
            , String redPacketAmount, String command) {
        return mNet.getApi().sendRedPacket(redPacketType, userId, redPacketCount, redPacketContent, destId, destType, redPacketAmount, command).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }*/

    public Observable<String> sendRedPacket(String content) {
        return mNet.getApi().sendRedPacket(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /*
     幸运红包
      */
    public Observable<String> sendLuckRedPacket(Long userId,Double money,String redPacketContent,String groupId) {
        return mNet.getApi().sendLuckRedPacket(userId,money,redPacketContent,groupId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<ValidateEntivity> getMsgHistory(String size, String destId, String destType, String userId, String startMsgId) {
        return mNet.getApi().getMsgHistory(size, destId, destType, userId, startMsgId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<RedPacketHistoryEntivity> getRedPacketHistory(String redPacketId, String userId) {
        return mNet.getApi().getRedPacketHistory(redPacketId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    public Observable<String> openRedPacket(String redPacketId, String userId) {
        return mNet.getApi().openRedPacket(redPacketId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 修改/设置  支付密码
     */
    public Observable<ValidateEntivity> setPayPwd(String pwd, String userId,String validateNum) {
        return mNet.getApi().setPayPwd(pwd, userId,validateNum).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 远程校验支付密码
     */
    public Observable<String> validatePayPwd(String pwd, String userId) {
        return mNet.getApi().validatePayPwd(pwd, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 转账给好友
     */
    public Observable<TransfreCreateEntivity> createTransfer(String content) {
        return mNet.getApi().createTransfer(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
        //ToolsUtils.getMyUserId()=17231--destId=null--amount=1--payPwde10adc3949ba59abbe56e057f20f883e
        //userId=17231&
    }

    /**
     * 转账给好友
     */
    public Observable<TransferViewEntivity> viewTransfer(String userId, String transId) {
        return mNet.getApi().viewTransfer(userId, transId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 确认收钱
     */
    public Observable<TransferViewEntivity> confimTransfer(String content) {
        return mNet.getApi().confimTransfer(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 通过 id 获取好友资料
     */
    public Observable<ImFriendEntivity> getUserById(String userId, String destId) {
        return mNet.getApi().getUserById(userId, destId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 取消置顶
     * destType:
     * 人     1
     * 群      2
     */
    public Observable<ValidateEntivity> cancleTop(String destId, String destType, String userId) {
        return mNet.getApi().cancleTop(destId, destType, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 通过群 id 获取群信息
     */
    public Observable<ImGroupEntivity> getGroupById(String groupId, String userId) {
        return mNet.getApi().getGroupById(groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 通过 userID 获取账户余额
     */
    public Observable<String> getBalance(String userId) {
        return mNet.getApi().getBalance(userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 通过 ID 获取 转账历史
     */
    public Observable<List<WalletDetailsEntity>> getWalletHistory(String userId) {
        return mNet.getApi().getWalletHistory(userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 更改群名称
     */
    public Observable<ValidateEntivity> updateGroup(String name, String groupId, String userId) {
        return mNet.getApi().updateGroup(name, groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 更改群昵称
     */
    public Observable<ValidateEntivity> updateGroupMemberMark(String groupId, String userId, String markName) {
        return mNet.getApi().updateGroupMemberMark(groupId, userId, markName).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 实名认证
     */
    public Observable<ValidateEntivity> updateAuth(String name, String validateNum, String userId, String idNo, String mobile) {
        return mNet.getApi().updateAuth(name, validateNum, userId, idNo, mobile).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 翻译
     */
    public Observable<FanYiBean> getTextFanYi(String q, String from, String to, String appid, String salt, String sign) {
        return mNet.getApiW().getTextFanYi(q, from, to, appid, salt, sign).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 获取支付web地址
     */
    public Observable<PayUrlInfoEntity> getPaypalUrl(String uid, String num, String price, String name, String total) {
        return mNet.getApiP().getPaypalUrl(uid, num, price, name, total).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     *
     */
    public Observable<VersionEntivity> getVersion() {
        return mNet.getApi().getVersion().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 获取认证状态
     */
    public Observable<PhpStatusEntivity> authcheck(String uid) {
        return mNet.getApiP().authcheck(uid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 微信支付登录
     */
    public Observable<weixinBean> login(String username, String password) {
        return mNet.getApiWP().login(username, password).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 获取用户APPID
     */
    public Observable<weixinBean> getAppList(String token) {
        return mNet.getApiWP().getAppList(token).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 获取用户APPID
     */
    public Observable<weixinQRData> getPayCodeUrl(String token, String total_fee, String title, String app_id) {
        return mNet.getApiWP().getPayCodeUrl(token, total_fee, title, app_id).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 获取用户APPID
     */
    public Observable<ContactImportEntity> importPhone(String phones, String uid) {
        return mNet.getApiP().importPhone(phones, uid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取用户APPID
     */
    public Observable<String> myContact(String phones, String uid, String pageNo) {
        return mNet.getApiP().myContact(phones, uid, pageNo).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 微信支付，把订单号传入Php服务器
     */
    public Observable<weixinBean> wxorders(String uid, String outTradeNo, String money) {
        return mNet.getApiP().wxorders(uid, outTradeNo,money).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 设置短信推荐人关系
     */
    public Observable<ValidateEntivity> setrefer(String uid, String mobile) {
        return mNet.getApiP().setrefer(uid, mobile).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 通过注册手机号获取推荐人id
     */
    public Observable<RequestRefereeEntity> getrefer(String mobile) {
        return mNet.getApiP().getrefer(mobile).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取朋友圈列表
     */
    public Observable<MyCircleItem> getcircle(String pageNo, String userid ){
        return  mNet.getApiP().getcircle(pageNo,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 获取自己的朋友圈
     */
    public Observable<MyCircleItem> getmycircle(String pageNo, String userid ){
        return  mNet.getApiP().getmycircle(pageNo,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 获取朋友的朋友圈
     */
    public Observable<MyCircleItem> getfriendcircle(String pageNo, String userid ){
        return  mNet.getApiP().getfriendcircle(pageNo,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 发布动态
     *
     * @param userid 自己uid
     @param text 文字
     @param images 图片链接  字符串，分开
     @param address 地址
     @param lat
     @param lng
     @param at   @好友 uid，分开
     @param priv  隐私 0公开 1私密 2部分可见 3不给谁看
     @param uids   部分可见  不给谁看  的好友uid
     @param video  小视频链接
     *
     */
    public Observable<SendCircleEntivity> postcircle(String images, String userid, String text, String address, String lat, String lng
            , String at, String priv, String uids, String video){
        return mNet.getApiP().postcircle(images,text,userid, address, lat, lng, at, priv, uids, video).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 发布赞
     */
    public Observable<ValidateEntivity> getparise(String userid,String feedid){
        return mNet.getApiP().getparise(feedid,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 发布赞
     */
    public Observable<ValidateEntivity> getconmment(String userid,String replyid,String feedid,String text){
        return mNet.getApiP().getconmment(feedid,userid,text,replyid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
    取消赞
     */
    public Observable<ValidateEntivity> delparise(String feedid,String userid){
        return mNet.getApiP().delparise(feedid,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 查找附近的人
     */
    public Observable<NearbyEntivity> getnearby(String lat , String lnt, String page , String userid){
        return mNet.getApiP().getnearby(lat,lnt,page,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 更新用户端位置
     */
    public Observable<ValidateEntivity> uplocation(String lat ,String lnt ,String userid){
        return mNet.getApiP().uplocation(lat,lnt,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 摇一摇
     */
    public Observable<YaoyiYao> yaoyiyao(String lat, String lnt , String userid){
        return mNet.getApiP().yaoyiyao(lat,lnt,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 好友朋友圈预览图片
     */
    public Observable<Circlepreview> getpreview(String userid, String destid){
        return mNet.getApiP().getpreview(userid,destid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 收款
     */
    public Observable<GetmoneyEntivity> getmoney(String content){
        return  mNet.getApiP().getmoney(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ;
    }
    /**
     * 向二维码付款
     */
    public Observable<ValidateEntivity> paymoney(String content){
        return mNet.getApiP().paymoney(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 添加收藏
     */
    public Observable<ValidateEntivity> addcolaction(String category,String url ,String content ,String fromname ,String userid ,String fromid){
        return mNet.getApiP().addcolaction(category,content,url,fromid,fromname,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取收藏
     */
    public Observable<ColactionEntity> getcolaction(String pageNo,String userId){
        return mNet.getApiP().getcolaction(pageNo,userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 取消收藏
     */
    public Observable<ValidateEntivity> deletelaction(String favoriteId,String userid){
        return mNet.getApiP().deletelaction(favoriteId,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 删除动态
     */
    public Observable<ValidateEntivity> deletecircle(String feedid,String userid){
        return mNet.getApiP().deletecircle(feedid,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取单条动态详情
     */
    public Observable<CircleItemEntity> getonecircle(String feedid, String userid){
        return mNet.getApiP().getonecircle(feedid,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 付款码
     */
    public Observable<PayTransferEntivity> paytransfer(String content){
        return mNet.getApiP().paytransfer(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 更换相册背景
     */
    public Observable<ValidateEntivity> setcircleback(String imgurl ,String userid){
        return mNet.getApiP().setcircleback(imgurl,userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取用户背景
     */
    public Observable<String> getfriendcircleback(String userid){
        return mNet.getApiP().getfriendcircleback(userid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取群公告列表
     * userId groupId pageNo
     */
    public Observable<GetNoticeListEntity> getNoteList(String userId, String groupId, String pageNo){
        return mNet.getApiP().getNoteList(userId, groupId, pageNo).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 发布群公告
     * userId groupId  content  title
     */
    public Observable<ValidateEntivity> createGroupNote(String userId, String groupId, String content, String title){
        return mNet.getApiP().createGroupNote(userId, groupId, content, title).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 发布群公告
     * userId groupId  content  title
     */
    public Observable<ValidateEntivity> updateGroupNote(String userId, String groupId, String noteId, String content, String title){
        return mNet.getApiP().updateGroupNote(userId, groupId, noteId, content, title).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * feed/setFeedAuth
     * 设置朋友圈权限
     * userId  friendId  priv 开启状态 0 关闭 1 开启 direct  0 设置我的朋友圈不给好友看权限  1 设置不看好友的朋友圈权限
     *
     */
    public Observable<ValidateEntivity> setFeedAuth(String userId, String friendId, String priv, String direct){
        return mNet.getApiP().setFeedAuth(userId, friendId, priv, direct).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 设置群头像chat/setGroupHeader
     * @ groupId          id
     * @ userId          请求人id
     * @ url            请求人id
     */
    public Observable<ValidateEntivity> setGroupHeader(String userId, String groupId, String url){
        return mNet.getApiP().setGroupHeader(userId, groupId, url).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 附近的人，获取列表
     * @ userId
     * @ latitude
     * @ longitude
     * @ sex
     * @ pageNo
     */
    public Observable<GlobalRoamingBeans> findNearby(String userId, String latitude, String longitude, String sex, String pageNo){
        return mNet.getApiP().findNearby(userId, latitude, longitude, sex, pageNo).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 充值支付，创建订单
     * userId,subject,amount,type,body
     */
    public Observable<RechargeOrderBean> createRechargeOrder(String content){
        return mNet.getApiP().createRechargeOrder(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 微信提现，
     * userId,amount,openid
     */
    public Observable<ValidateEntivity> withdraw(String content){
        return mNet.getApiP().withdraw(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 支付宝提现，
     * userId,amount,openid
     */
    public Observable<ValidateEntivity> alipayWithdraw(String content){
        return mNet.getApiP().alipayWithdraw(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 投诉  chat/report
     * @param destId          id
     * @param userId          请求人id
     * @param destType        1个人 2群组
     * @param imgs            图片 逗号隔开
     * @param msg             图片 逗号隔开
     */
    public Observable<ReportResultBean> report(String userId, String destId, String destType, String imgs, String msg){
        return mNet.getApiP().report(userId, destId, destType, imgs, msg).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 编辑群简介  chat/updateGroupDesc
     * @param groupId          id
     * @param userId          请求人id
     * @param descriptions
     */
    public Observable<ValidateEntivity> updateGroupDesc(String userId, String groupId, String descriptions){
        return mNet.getApiP().updateGroupDesc(userId, groupId, descriptions).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 设置群管理员 chat/setGroupAdmin
     * @param groupId          id
     * @param userId          请求人id
     * @param destId
     * @param isSet           1 为设置  其他都是取消
     */
    public Observable<ValidateEntivity> setGroupAdmin(String userId, String groupId, String destId, String isSet){
        return mNet.getApiP().setGroupAdmin(userId, groupId, destId, isSet).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 设置群管理员 chat/setGroupAdmin
     * @param groupId          id
     * @param userId          请求人id
     */
    public Observable<ValidateEntivity> dismissGroup(String groupId, String userId){
        return mNet.getApiP().dismissGroup( groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 设置群管理员 chat/transGroup
     * @param groupId          id
     * @param userId          请求人id
     * @param destId          对方id
     */
    public Observable<ValidateEntivity> transGroup(String groupId, String userId, String destId){
        return mNet.getApiP().transGroup( groupId, userId, destId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 设置群管理员 chat/transGroupConfirm
     * @param groupId          id
     * @param userId          请求人id
     * @param accept          1是同意
     */
    public Observable<ValidateEntivity> transGroupConfirm(String groupId, String userId, String accept){
        return mNet.getApiP().transGroupConfirm( groupId, userId, accept).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 赠送礼物 /feed/sendFeedGift
     *  @param feedId 动态id
     *  @param destId 接收方用户id
     *  @param gift 礼物实体
     *  @param userId 赠送方用户id
     */
    public Observable<ValidateEntivity> sendFeedGift(String feedId, String destId, String gift, String userId){
        return mNet.getApiP().sendFeedGift( feedId, destId, gift, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 赠送礼物 /feed/sendFeedGift
     *  @param pageNo 页数
     *  @param userId 用户id
     */
    public Observable<MyGiftItem> myGift(String pageNo, String userId){
        return mNet.getApiP().myGift( pageNo, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取靓号类型 /pay/getNumberType
     *
     */
    public Observable<LiangSortItem> getNumberType(){
        return mNet.getApiP().getNumberType().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 获取靓号类型 /pay/getVipNumber
     *
     */
    public Observable<GetVipNumBean> getVipNumber(String sessid, String type){
        return mNet.getApiP().getVipNumber(sessid, type).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 创建购买靓号的订单 /pay/createNumberOrder
     * amount	价格	string	@mock=0.01
     body	项目标题 可以为空	string	@mock=SAMIM
     headUrl	头像url
     mobile	手机号	string	@mock=+8615615293966
     name	昵称	string	@mock=shine
     number	号码	string	@mock=666999
     pwd	密码	string	@mock=123456
     sessid	seesionid	string	@mock=52896E0BEB726D525E059001D440837C
     subject	支付项目 不能为空	string	@mock=靓号购买
     type	支付方式	string	@mock=alipay
     validateNum	验证码
     */
    public Observable<RechargeOrderBean> createNumberOrder(String amount, String body, String headUrl, String mobile, String name, String number
            , String pwd, String sessid, String subject, String type, String validateNum, String userId){
        return mNet.getApiP().createNumberOrder(amount, body, headUrl, mobile, name, number, pwd, sessid, subject, type, validateNum, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 检测靓号 /pay/checkNumber
     * number
     */
    public Observable<RechargeOrderBean> checkNumber(String number){
        return mNet.getApiP().checkNumber(number).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 群公告删除 chat/deleteGroupNote
     * noteId
     groupId
     userId
     */
    public Observable<ValidateEntivity> deleteGroupNote(String noteId, String groupId, String userId ){
        return mNet.getApiP().deleteGroupNote(noteId, groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 意见反馈 chat/feedback_submit
     * userId
     * feedbackid
     * content
     * pic
     * mobile
     *
     */
    public Observable<ValidateEntivity> addFeedInfor(String userId,  String content , String imags , String mobile ){
        return mNet.getApiP().addFeedInfor(userId, content, imags, mobile).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 发送AA收款 transfer/aaTrans
     * counts 收款个数 number @mock=2
     destId 群或者用户id string @mock=17228
     destType 1个人 2群组 number @mock=1
     msg 收款显示文字 string @mock=AA收款
     totalAmount 总金额 number @mock=2
     userId
     *
     */
    public Observable<AAentivity> aaTrans(String content){
        return mNet.getApiP().aaTrans(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 获取AA收款 transfer/aaTransDetail
     * transId AA收款id number @mock=1
     userId
     *
     */
    public Observable<AATransDetailBean> aaTransDetail(String transId, String userId ){
        return mNet.getApiP().aaTransDetail(transId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * AA收款-付款 transfer/aaTransPay
     * amount 付款金额 string @mock=0.01
     destId 收款用户id string @mock=17229
     payPwd 支付密码 string @mock=sdsadsa
     transId 转账ID string @mock=2
     userId

     *
     */
    public Observable<ValidateEntivity> aaTransPay(String content){
        return mNet.getApiP().aaTransPay(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     幸运红包

     *
     */
    public Observable<ValidateEntivity> partakeLuckRedPacket(String userId,String redPacketId,String groupId){
        return mNet.getApiP().partakeLuckRedPacket(userId,redPacketId,groupId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     幸运红包详情
     *
     */
    public Observable<queryLuckRedPacketEntivity> queryLuckRedPacket(String userId, String redPacketId, String groupId){
        return mNet.getApiP().queryLuckRedPacket(userId,redPacketId,groupId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }
    /**
     * 删除群成员 chat/removeGroupMember
     * destId 被删除的成员id number 17265
     * groupId 群组id number 62
     * userId 群主id或者群管理id number 17229
     */
    public Observable<ValidateEntivity> removeGroupMember(String destId, String groupId , String userId ){
        return mNet.getApiP().removeGroupMember(destId, groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 更新加群验证 chat/updateJoinstatus
     * answer  string @mock=发红包
     * groupId  number @mock=56
     * question  string @mock=你的加入谜底
     * status  number @mock=0
     * userId  number @mock=17228
     */
    public Observable<ValidateEntivity> updateJoinstatus(String answer, String groupId , String question , String status , String userId , String fee ,String days){
        return mNet.getApiP().updateJoinstatus(answer, groupId, question, status, userId, fee,days).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }


    /**
     * 申请加入群组 chat/requestGroupJoin
     * answer  string @mock=验证问题
     * groupId  number @mock=96
     * userId  number @mock=17229
     */
    public Observable<ValidateEntivity> requestGroupJoin(String answer, String groupId , String userId ){
        return mNet.getApiP().requestGroupJoin(answer, groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 付费加群 /chat/payForGroupJoin
     * groupId  number @mock=566
     * pwd  string @mock=sdsadsadsa
     * userId  number @mock=17288
     */
    public Observable<ValidateEntivity> payForGroupJoin(String pwd, String groupId , String userId ){
        return mNet.getApiP().payForGroupJoin(pwd, groupId, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 审核群成员/更新群成员禁言状态 /chat/updateGroupMember
     * destId 群成员id number @mock=17228
     * groupId 群组id number @mock=2643
     * ope  number @mock=0
     * type  number @mock=1
     * userId  number @mock=17234
     */
    public Observable<ValidateEntivity> updateGroupMember(String destId, String groupId, String ope, String type, String userId){
        return mNet.getApiP().updateGroupMember(destId, groupId, ope, type, userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 获取群等级配置 /chat/queryGroupConfig
     * userId  number @mock=17234
     */
    public Observable<GroupLevelEntity> queryGroupConfig(String userId){
        return mNet.getApiP().queryGroupConfig(userId).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 升级群 /chat/payForGroupLevel
     * groupId  number @mock=656
     * level 即将升级的级别 number @mock=2
     * pwd  string @mock=dsadfsafdsafdosaf
     * userId  number @mock=17228
     */
    public Observable<ImGroupEntivity> payForGroupLevel(String content){
        return mNet.getApiP().payForGroupLevel(content).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
    }

    /**
     * 收藏或取消收藏群
     * @param userId
     * @param groupId
     * @param favorite
     * @return
     */
    public Observable<InfoBean> favoriteGroup(String userId, String groupId, String favorite){

        return mNet.getApi().favoriteGroup(userId, groupId, favorite);
    }
    /**
     * 全体禁言或者取消禁言
     * @param userId
     * @param groupId
     * @param ope
     * @return
     */
    public Observable<InfoBean> opeGroup(String userId, String groupId, String ope){

        return mNet.getApi().opeGroup(userId, groupId, ope);
    }
}
